package cn.gjculture.shopping.api.dao;

import cn.gjculture.shopping.api.entity.Logistics;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface LogisticsDao {

    @Insert("insert into logistics(logisticsId,goodsRecordId,logisticsType,logisticsCom,logisticsNum,orderId) " +
            "values(#{logisticsId},#{goodsRecordId},#{logisticsType},#{logisticsCom},#{logisticsNum},#{orderId})")
    int insert(Logistics logistics);

    @Select("select * from logistics where goodsRecordId=#{goodsRecordId}")
    List<Logistics> queryByGoodsRecordId(String goodsRecordId);

    @Delete("delete from logistics where logisticsId=#{logisticsId}")
    int delete(String logisticsId);
}
